<template>
  <el-tag v-if="prop.data" :type="current.type">{{ current.name }}</el-tag>
</template>
<script setup lang="ts">

import {computed} from "vue";
import {Dict} from "@/api/common.ts";

const prop = defineProps<{ data: Dict[], modelValue: number }>()
const current = computed(() => {
  if (!prop.data) {
    return;
  }
  for (let datum of prop.data) {
    if (datum.code == prop.modelValue) {
      return {"name": datum.value, "type": datum.type}
    }
  }
})
</script>
